package com.dodoke.domain;

import com.dodoke.common.annotation.Excel;
import com.dodoke.common.core.domain.BaseEntity;
import com.dodoke.domain.vo.WxGoodsAttrVo;
import com.dodoke.domain.vo.WxImageVo;
import com.dodoke.validateGroup.OnAdd;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.List;

/**
 * 【商品】对象 wx_goods
 * 
 * @author dodoke
 * @date 2020-08-25
 */
@ApiModel("商品对应的实体类")
public class WxGoods extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    @Null(groups = {OnAdd.class})
    @ApiModelProperty(value = "不需要传")
    private Long id;

    /** 商品名称 */
    @Excel(name = "商品名称")
    @NotBlank(message = "商品名称不允许为空",groups = {OnAdd.class})
    @ApiModelProperty(value = "商品名称",required = true)
    private String name;

    /** 商品描述 */
    @Excel(name = "商品描述")
    @ApiModelProperty("商品描述")
    private String description;

    /** 成本 */
    @Excel(name = "成本")
    @NotNull(message = "成本不允许为空",groups = {OnAdd.class})
    @ApiModelProperty(value = "商品成本",required = true)
    private Double costPrice;

    /** 中奖价 */
    @Excel(name = "中奖价")
    @NotNull(message = "中奖价不允许为空",groups = {OnAdd.class})
    @ApiModelProperty(value = "中奖价",required = true)
    private Double winningPrice;

    /** 原价 */
    @Excel(name = "原价")
    @NotNull(message = "原价不允许为空",groups = {OnAdd.class})
    @ApiModelProperty(value = "原价",required = true)
    private Double originPrice;

    /** 运费 */
    @Excel(name = "运费")
    @NotNull(message = "运费不允许为空",groups = {OnAdd.class})
    @ApiModelProperty(value = "运费",required = true)
    private Long expressPrice;

    /** 库存 */
    @Excel(name = "库存")
    @NotNull(message = "库存不允许为空",groups = {OnAdd.class})
    @ApiModelProperty(value = "库存",required = true)
    private Long count;

    /** 概率,不填默认为16%的概率(数据库设置) */
    @Excel(name = "概率")
    @ApiModelProperty("概率")
    private Long probability;

    @JsonIgnore
    private List<WxImage> wxImageList;

    @JsonIgnore
    private List<WxGoodsAttr> wxGoodsAttrList;

    private List<WxImageVo> wxImageVoList;

    private List<WxGoodsAttrVo> wxGoodsAttrVoList;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }
    public void setCostPrice(Double costPrice)
    {
        this.costPrice = costPrice;
    }

    public Double getCostPrice()
    {
        return costPrice;
    }
    public void setWinningPrice(Double winningPrice)
    {
        this.winningPrice = winningPrice;
    }

    public Double getWinningPrice()
    {
        return winningPrice;
    }
    public void setOriginPrice(Double originPrice)
    {
        this.originPrice = originPrice;
    }

    public Double getOriginPrice()
    {
        return originPrice;
    }
    public void setExpressPrice(Long expressPrice)
    {
        this.expressPrice = expressPrice;
    }

    public Long getExpressPrice() 
    {
        return expressPrice;
    }
    public void setCount(Long count) 
    {
        this.count = count;
    }

    public Long getCount() 
    {
        return count;
    }
    public void setProbability(Long probability) 
    {
        this.probability = probability;
    }

    public Long getProbability() 
    {
        return probability;
    }

    public List<WxGoodsAttr> getWxGoodsAttrList() {
        return wxGoodsAttrList;
    }

    public void setWxGoodsAttrList(List<WxGoodsAttr> wxGoodsAttrList) {
        this.wxGoodsAttrList = wxGoodsAttrList;
    }

    public List<WxImage> getWxImageList() {
        return wxImageList;
    }

    public void setWxImageList(List<WxImage> wxImageList) {
        this.wxImageList = wxImageList;
    }

    public List<WxImageVo> getWxImageVoList() {
        return wxImageVoList;
    }

    public void setWxImageVoList(List<WxImageVo> wxImageVoList) {
        this.wxImageVoList = wxImageVoList;
    }

    public List<WxGoodsAttrVo> getWxGoodsAttrVoList() {
        return wxGoodsAttrVoList;
    }

    public void setWxGoodsAttrVoList(List<WxGoodsAttrVo> wxGoodsAttrVoList) {
        this.wxGoodsAttrVoList = wxGoodsAttrVoList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("description", getDescription())
            .append("costPrice", getCostPrice())
            .append("winningPrice", getWinningPrice())
            .append("originPrice", getOriginPrice())
            .append("expressPrice", getExpressPrice())
            .append("count", getCount())
            .append("probability", getProbability())
            .toString();
    }
}
